#include "GMFileStream.h"


namespace io
{

GMFileStream::GMFileStream( void )
{
	m_stream = 0;
}


GMFileStream::~GMFileStream( void )
{
	close();
}


bool GMFileStream::open( const char* filename, const char* mode )
{
	if( !m_stream )
	{
		fopen_s( &m_stream, filename, mode );	

		if( m_stream )
		{
			return true;
		}
	}

	return false;
}


void GMFileStream::close( void )
{
	if( m_stream )
	{
		fclose( m_stream );
		m_stream = 0;
	}
}


void GMFileStream::read_line( char* buffer, size_t size )
{
	fgets( buffer, size, m_stream );
}

};